<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
                 com.scalar.chiptrack.commons.Constants,
                 com.scalar.chiptrack.operations.process.forms.BomPartEntryForm"%>
 <%--
  Created by IntelliJ IDEA.
  User: Murali Krishna Yengala
  Date: May 12, 2005
  Time: 10:25:54 AM
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<chiptrack:checkLogon sourcePage="/kitMaking.do?action=BoardMaking" />
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<html>
    <HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
        <META http-equiv=Content-Type content="text/html; charset=windows-1252">
        <LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
    </HEAD>
    <BODY bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0" >
    <script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
    <script src="<%=chipTracContext%>/jsp/includes/scripts/bomPartEntry.js"></script>
    <script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
    <SCRIPT language="JavaScript">

    function submitPage()
    {

        if( document.bomReportForm.assemblyProcessStepId.value == '-1' || document.bomReportForm.assemblyProcessStepId.value == '0')
        {
            var pa	= document.getElementById("errors");
            document.getElementById("chiptracErrors").innerText='';
            pa.innerHTML = "<li> Please select a valid Part Number " ;
            return;
        }
        else
        {
            document.bomReportForm.action.value = "showReport";
            document.bomReportForm.submit();
        }
    }

    </script>
    <!-- Top Header Start-->
    <%@ include file="/jsp/includes/header.jsp" %>
    <!-- Top Header End-->
    <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
      <TBODY >
      <TR>
        <TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

        <!-- Side Navigation start -->
        <%@ include file="/jsp/operations/reports_side_menu.jsp" %></TD>
        <!-- end of the side navigations -->

        <TD bgcolor="#ffffff">
        <IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
        <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
        <TD valign="top" width="100%">

        <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
        <BR>
        <!-- from here your body starts -->
        <html:form action="/bomReport" name="bomReportForm" type="com.scalar.chiptrack.operations.process.forms.BomReportForm">
        <input name="action" type="hidden" value="">
        <TABLE width='95%' align=right cellpadding='3' cellspacing='2' border='0' bordercolor='black'>
                <TR><Td colspan='4' class="NArialW" align=center>BOM Report</td></tr>
                <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
                <tr><td colspan='4' align="left" class='NArialL'>&nbsp;<FONT id="errors" color='FF0000'></font></td></tr>
                <TR><TD colspan='4' id="chiptracErrors"><chiptrack:errors styleClass="NArialL"/></TD></TR>
                <TR><TD colspan='4'><chiptrack:info styleClass="NArialL"/></TD></TR>
                <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
                <TR><TD class='NArialL' width="30%">Assembly Part Number :<br>
                <%--(<bean:message key = "label.mfgPartNumber" />)--%>
                </TD>
                    <TD class="NArialL" colspan='3'>
                        <html:select property="assemblyProcessStepId" styleClass="txfield"  onchange="javascript:submitPage();" >
                        <html:option value="-1">Select Assembly Part Number</html:option>
                        <html:option value="0">-----------</html:option>
                        <html:options collection="assemblyParts" property="processStepId" labelProperty="partNumber"/>
                        </html:select>
                    </TD>
                </TR>
                <TR><TD colspan='4'>
                    <IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='20'>
                </TD></TR>
                <TR><TD colspan='4'>
                    <IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='20'>
                </TD></TR>
                <logic:equal name="showDetails" value="TRUE">
                    <TR>
                        <td align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">BOM Part Number</font></font></td>
                        <td align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Qty Req/Unit</font></font></td>
                        <td align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Qty Available</font></font></td>
                        <td align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Qty To Pull</font></font></td>
                     </TR>
                     <logic:iterate name="bomPartsList" id="bomPart" type="com.scalar.chiptrack.operations.process.BomPartForReport" scope="request">
                        <tr>
                           <td bgcolor="#DEE1E2"><font class="NArialL"><bean:write name="bomPart" property="bomPartNo" /></font></td>
                           <td bgcolor="#DEE1E2"><font class="NArialL"><bean:write name="bomPart" property="qtyReqPerUnit" /></font></td>
                           <td bgcolor="#DEE1E2"><font class="NArialL"><bean:write name="bomPart" property="qtyAvailable" /></font></td>
                           <td bgcolor="#DEE1E2"><font class="NArialL"><bean:write name="bomPart" property="qtyToPull" /></font></td>
                        </tr>
                    </logic:iterate>
                    <TR><TD colspan='4'>
                        <IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='20'>
                    </TD></TR>
                    <TR>
                        <TD class='NArialL' colspan='4'>Max No of Assembly that can be Packaged : </font><bean:write name="bomReportForm" property="maxAssembly"/></TD>
                     </TR>
                </logic:equal>
            </table>
        </html:form>
        <!-- till here -->
        <BR><BR><BR></TD>
        <TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
        </TR>
        </TABLE>
        <!-- Footer starts here -->
        <%@ include file="/jsp/includes/footer.jsp" %>
        <!-- footer end here -->
    </body>
</html>